package com.xujc.listener;

import com.xujc.Global;
import com.xujc.InfoManager;
import com.xujc.ui.MainJFrame;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class StuListener implements ActionListener {
    @Override
    public void actionPerformed(ActionEvent e) {
        System.out.println("查看学生信息按键被按下了！");
        MainJFrame showStuJFrame= Global.inintMainJFrame();
        //展示学生信息
        InfoManager infoManager=Global.infoManager;

        JLabel label = new JLabel(infoManager.getAllStudentsData());
        showStuJFrame.getContentPane().add(label);
        showStuJFrame.revalidate();//刷新窗口，不然需要等待一会才显示信息

    }
}
